function isAnagram(s: string, t: string): boolean {
  if (s.length !== t.length) {
    return false;
  }
  let sArray: string[] = s.split("");
  let tArray: string[] = t.split("");
  sArray.sort();
  tArray.sort();
  if (sArray.toString() === tArray.toString()) {
    return true;
  } else {
    return false;
  }
}
console.log(isAnagram("ab", "ba"));
